import request, {buildQueryString} from "@/utils/request";
export interface RoleSearchForm {
    roleName: string;
    roleDesc: string;
    createTimeRange: string[];
    updateTimeRange: string[];
    dataStatus?: number;
    page?: number;
    pageSize?: number;
}
export function getRoleList(data: RoleSearchForm) {
    return request.get(`/role/list${buildQueryString(data)}`)
}
export interface  RoleForm {
    roleName: string;
    roleDesc: string;
    dataStatus: number;
    menuIds: number[];
}
export function insertRole(roleForm: RoleForm) {
    return request.post("/role",roleForm)
}
export interface UpdateRoleForm extends RoleForm{
    id: number;
}
export function updateRole(updateRoleForm: UpdateRoleForm) {
    return request.put("/role",updateRoleForm)
}
export function getRoleById(id: number) {
    return request.get(`/role/getById/${id}`)
}
export  function deleteRole(id: number) {
    return request.delete(`/role/${id}`)
}
export function getAllRole() {
    return request.get("/role/all")
}
